DEMO: Let's learn a new coding term called dot notation! Dot notation is how we use unique variable names to control sprites.

We've stored numbers in unique variables. You can also store sprites in variables!

We use dot notation to assign command to specific sprites, like this: sprite.action()

  • When we have multiple sprites in our program, we need to use dot notation to tell different sprites what to do.

To navigate the page using the TAB key, first press ESC to exit the code editor.

athlete = codesters.Sprite("player1") athlete.move_right(200) athlete2 = codesters.Sprite("player2") athlete2.move_right(100)
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)